<%@ page contentType="text/html;charset=UTF-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="lib/html5shiv.js"></script>
    <script type="text/javascript" src="lib/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css"/>
    <link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.8/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin"/>
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css"/>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="static/element/index.css">
    <!--[if IE 6]>
    <script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title></title>
    <style>

        * {
            padding: 0;
            margin: 0;
        }

        html {
            overflow-y: hidden;
        }

        body, html {
            width: 100%;
            height: 100%;
        }

        body {
            display: flex;
            flex-flow: column;
        }

        .fheader {
            height: 1%;
            min-height: 43px;
        }

        .fsection {
            /*flex-grow: 1;*/
            display: flex;
            flex-flow: row;
            /*height: 99%;*/
            min-height: 0;
        }

        .fnav {
            width: 400px;
            padding: 1px;
        }

        .farticle {
            flex: 1;
            padding: 1px;
        }

        .el-table__body tr:hover > td {
            background-color: #DFDFDF !important;
            cursor: default
        }

    </style>
</head>
<body>
<div id="app">
    <div class="fheader" style="padding: 0;margin: 0 ">
        <nav class="breadcrumb" style="height: 100%; padding: 0;margin: 0 ">
            <span class="r" style="padding-top: 2px">共计数量：[&nbsp;<strong>{{iiCount}}</strong> 条]</span>
            <a class="btn btn-primary radius r" style="line-height:1.6em; margin-left: 5px; margin-right: 5px; margin-top: 6px" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
        </nav>
    </div>
    <div class="fsection">
        <div class="farticle" style="padding: 5px 5px 5px">
            <table style="table-layout:fixed; width: 100%; word-break:break-all; " class="table table-border table-bordered table-bg table-hover table-sort table-responsive" id="tablelist">
                <thead>
                <tr class="text-c" style="height:0px;">
                    <th style="width: 100px">编号</th>
                    <th style="width: 200px">名称</th>
                    <th style="width: 300px">图片</th>
                    <th style="width: 300px">创建时间</th>
                    <th>操作</th>
                </tr>

                </thead>
                <tbody id="datalist">
                <tr class='text-c' style="height: 100px" v-for="item in tableData" :key="item.VALUE01" v-cloak>
                    <td> {{item.VALUE01}}</td>
                    <td> {{item.VALUE02}}</td>
                    <td>
                        <img v-if="base64" :src="base64" class="avatar" alt="" @click="fShowMax" style="padding: 0; margin: 0; height: 180px; width: 210px ">
                        <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                    </td>
                    <td> {{item.VALUE04}}</td>
                    <td class='td-manage'>
                        <input class="btn btn-secondary-outline radius" type="button" value="编辑" @click="adminEdit('支付二维码维护',item,'800','540', 0)">
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="static/axios.min.js"></script>
<script type="text/javascript" src="./static/vue"></script>
<script src="static/element/index.js"></script>
<script type="text/javascript">
    let vm = new Vue({
        el: '#app',
        data: {
            iiCount: 0,
            base64: '',
            tableData: [],      //--具体人员信息表
        },
        methods: {
            fShowMax() {
                let self = this
                layer.open({
                    type: 2,
                    area: ['800px', '400px'],
                    fix: false, //不固定
                    maxmin: true,
                    shade: 0.4,
                    title: "收款二维码",
                    content: ['w_zxkj_qrcodeshow.jsp', 'no'],
                    success: function (layero, index) {
                        layer.full(index)
                        const iframeWin = window[layero.find('iframe')[0]['name']];   //--通过将弹出的layer窗口中将vue中的函数在created周期中赋给windows，
                        iframeWin.fInit({
                            "base64": self.base64,
                        })
                    },
                });
            },

            fInit() {
                let self = this
                let params = new URLSearchParams();
                params.append('CMD', "BD1127005A814831BEFD841BB1DAD89B");
                axios.post('/f_wscl/com2', params)
                    .then(function (res) {
                        //--db1左边表结构的树  db2人员分类
                        let {db1, db2} = res.data
                        if (db2[0].VALUE01 === 'ZZ01') {
                            layer.msg(db2[0].VALUE02, {icon: 0, time: 2000});
                        } else {
                            self.tableData = db1
                            self.base64 = self.tableData[0].VALUE03
                            if (self.base64)
                                if (self.base64.indexOf("base64,") === -1) {
                                    self.base64 = "data:image/jpg;base64," + self.base64;
                                }
                            self.iiCount = db2[0].VALUE01
                        }
                    })
                    .catch(function (error) {
                        layer.msg('网络异常错误', {icon: 1, time: 1000});
                    });
            },

            /*编辑和新增*/
            //--   jud=0修改    jud=1新增
            adminEdit(title, obj, w, h, jud) {
                if (title == null || title === '') {
                    title = false;
                }
                if (w == null || w === '') {
                    w = 800;
                }
                if (h == null || h === '') {
                    h = ($(window).height() - 50);
                }
                let ls_opid = "${sessionOpid}";
                layer.open({
                    type: 2,
                    area: [w + 'px', h + 'px'],
                    fix: false, //不固定
                    maxmin: false,
                    shade: 0.4,
                    title: title,
                    content: ['w_zxkj_qrcodeedit.jsp', 'no'],
                    success: function (layero, index) {
                        let body = layer.getChildFrame('body', index);//少了这个是不能从父页面向子页面传值的
                        const iframeWin = window[layero.find('iframe')[0]['name']];   //--通过将弹出的layer窗口中将vue中的函数在created周期中赋给windows，
                        iframeWin.fInit({
                            "opid": ls_opid,
                            "do": jud,
                            "ryzh": obj.VALUE01,
                            "ryxm": obj.VALUE02,
                            "base64": obj.VALUE03,
                            "tip": obj.VALUE05
                        })
                    },
                });
            },
        },
        mounted() {
            window.fInit = this.fInit
        },
        created() {
            this.fInit()
        }
    });
</script>

</body>
</html>
